package com.example.activity_service.controller;

import com.example.activity_service.service.YssQueryService;
import com.example.activity_service.vo.Red;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@RestController
@CrossOrigin
@ResponseBody
public class YssController {

    @Autowired
    YssQueryService service;

    @RequestMapping("/chahb")
    public List<Red>searchhb()
    {
        List<Red>list=service.searchhb();
        return list;
    }

    @RequestMapping("/chasyhb")
    public List<Red>searchsyhb()
    {
        List<Red>list=service.searchsyhb();
        return list;
    }


    @RequestMapping("/chagqhb")
    public List<Red>searchgqhb(){
        List<Red>list=service.searchgqhb();
        return list;
    }

    @RequestMapping("/chajf")
    public List<Red>searchjf(){
        List<Red>list=service.searchgqhb();
        return list;
    }



    @RequestMapping("/xgsyhb")
    public int updatezt
            ( @RequestParam("id")int id,
              @RequestParam("status")int status
              )
    {
        service.updatezt(id, status);
        return 1;
    }



//    @RequestMapping("/sggq")
//    public int updategq(
//            @RequestParam("id")int id,
//            @RequestParam("status")int status,
//            @RequestParam("timedata")Date timedata
//            ){
//
//
//
//    }
}
